* This makes FileRenderExpensive pool logic apply for large files
to cut down on DB load from getMetaTree()
Bug: T96360
Change-Id: If892d77077607ffcaba0510355175a1e4d780ae9
* @ingroup Media
*/
class DjVuHandler extends ImageHandler {
+ const EXPENSIVE_SIZE_LIMIT = 10485760; // 10MiB
+
/**
* @return bool
*/
return true;
}
+ /**
+ * True if creating thumbnails from the file is large or otherwise resource-intensive.
+ * @param File $file
+ * @return bool
+ */
+ public function isExpensiveToThumbnail( $file ) {
+ return $file->getSize() > static::EXPENSIVE_SIZE_LIMIT;
+ }
+
/**
* @param File $file
* @return bool